package edu.cmu.vlis.datamining.core;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.jgrapht.alg.NeighborIndex;

import edu.cmu.vlis.datamining.SimilarityFeatures.AdamicAldarMeasure;
import edu.cmu.vlis.datamining.SimilarityFeatures.CommonNeighbors;
import edu.cmu.vlis.datamining.SimilarityFeatures.JaccardCoefficient;
import edu.cmu.vlis.datamining.SimilarityFeatures.PreferentialAttachment;
import edu.cmu.vlis.datamining.TopologicalFeatures.CascadeSimilarity;

public class FeatureList {

    NeighborIndex<Vertex, Edge> _neighborIndex;
    List<IFeatureCalculator> featureList;
    private Map<Vertex,Set<Integer>> cascadeFList;
    
    public FeatureList(NeighborIndex<Vertex, Edge> neighborIndex, Map<Vertex, Set<Integer>> cascadeFList) {
        this.featureList = null;
        this._neighborIndex = neighborIndex;
        this.cascadeFList = cascadeFList;
    }
    
    public List<IFeatureCalculator> getFeatureList(){
    
        if( null != this.featureList)
            return this.featureList;
        
        this.featureList= new ArrayList<IFeatureCalculator>(5);
        
        this.featureList.add( new AdamicAldarMeasure(this._neighborIndex));
        this.featureList.add(new CommonNeighbors(this._neighborIndex));
       // this.featureList.add(new KatzMeasure(this.graph)); // not yet implemented
        this.featureList.add(new PreferentialAttachment(this._neighborIndex));
        this.featureList.add(new JaccardCoefficient(this._neighborIndex));
        this.featureList.add(new CascadeSimilarity(cascadeFList));
        
        return featureList;
    }
    
    public int numberOfFeatures(){
        return this.getFeatureList().size();
    }
}
